import request from '@/utils/request'
// import store from '@/store'
//获取用户资料请求
export const getUserProfile = () => {
    let res = request({
        url: '/v1_0/user',
        // headers: {
        //     Authorization:`Bearer ${store.getters.token}`
        // }
    })
    return res //res是一个Promise
}
/**
 * 获取当前登录用户的个人资料
 */
 export const getUserInfo = target => {
    return request({
      method: 'GET',
      url: '/v1_0/user/profile'
    })
}
  
//更新用户资料
export const updateUserInfo = data => request({
    method: 'PATCH',
    url: '/v1_0/user/profile',
    data
})

//更新用户头像
export const updateUserPhoto = data => request({
    method: 'PATCH',
    url: '/v1_0/user/photo',
    data
})